﻿<html>
<head>
<title>加载历史回单映射数据</title>
<style type="text/css">

Body.MyBody
{
	
	/*background-color:#FFFFFF;*/
	/*background-color:yellow;*/
	font-family: "宋体"; 
	font-size: 12px;
	margin: 0px 0px 0px 0px;  
	padding:0px 0px 0px 0px;
	color: #000000;
	background-color:#ffffff;

}

Table.MyGrid
{	
	color: #2E4343;
	font-weight: normal;
	font-size: 10px;
	font-family: "MS Sans Serif", "Microsoft Sans Serif", sans-serif;	
	border-width:0px;	
}


Table.MyGrid td.gridHeader
{
	background-color:#ffffff;
	height:20px;width:100%;
	border:1px solid #A8CEC1;border-left-width:1px;border-right-width:0px;
	font-weight: bold;
	font-size: 10px;
	font-family: "MS Sans Serif", "Microsoft Sans Serif", sans-serif;
	color: #2E4343;
	text-align:left;
	padding-left:1px;padding-right:1px;
}



Table.MyGrid a
{
  color: #2E4343;
  font-weight: bold;
  text-decoration: underline;
}

Table.MyGrid td
{
	text-align:left;
	padding-left:8px;padding-right:8px;
	margin:0px;
	border:1px solid #A8CEC1;border-top:0px;border-right:0px;border-bottom:0px;
}

Table.MyGrid img
{
	cursor:hand;
}

Table.MyGrid td.BorderLeft
{
	text-align:left;
	padding-left:8px;
	margin:0px;
	border:0px solid #A8CEC1;border-top:0px;border-bottom:0px;
}

Table.MyGrid td.BorderBottom
{
	text-align:left;
	padding-left:8px;
	margin:0px;
	border:1px solid #A8CEC1;border-top:0px;border-right:0px;
}

Table.MyGrid td.BorderBottomLeft
{
	text-align:left;
	padding-left:8px;
	margin:0px;
	border:1px solid #A8CEC1;border-top:0px;border-left:0px;border-right:0px;
}

Table.MyGrid
{
	color: #333333;
	font-weight: normal;
	font-size: 12px;
	font-family: "宋体";			
}

Table.MyGrid td.gridHeader
{			
	background-image: Url(../../images/Today/THBackgroundOff.gif);
	height:18px;width:100%;		
	border:1px solid #DCDDDE;border-left-width:1px;border-right-width:0px;
	/*font-weight: bold;*/
	font-family:  "宋体"; 
	font-size: 12px;
	/*color: #455C27; mod by ben 05/06/29	*/
	color: #000000;	
	text-align:left;
	padding-left:1px;padding-right:1px;
}

Table.MyGrid td.gridHeaderL
{
	background-color:#5C85B3;
	height:22px;
	font-size: 12px;
	font-family: "MS Sans Serif", "Microsoft Sans Serif", sans-serif;
	color: #FFFFFF;
	
}

Table.MyGrid a
{
  /*color: #455C27;*/
  color: #333333;
  font-weight: bold;
  text-decoration: underline;
}

Table.MyGrid td.BorderLeft
{
	padding-left:8px;
	margin:0px;
	border:0px solid #A8CEC1;border-top:0px;border-bottom:0px;
}

table.MyField
{
	border: solid 0px #CDCDCD;
	padding: 0px 0px 0px 0px;
}
Table.MyGrid input.MyField
{
	
  width: 150px;
	background-color: #ffffff;
	border: solid 0px #CDCDCD;
	height: 18px;
	padding-left:1px;
}

Table.MyGrid td.MyField
{
	border: solid 0px #000000;
	padding: 0px 0px 0px 0px;
}

table.divVset
{
	border : solid 1px #000000;
	padding: 0px 0px 0px 0px;
}

table.divVset td.nothit
{
	border: solid 1px #C1FFE4;
	padding: 2px 2px 2px 2px;
	background-color: #C1FFE4;
	white-space:nowrap;
	font-size: 12px;
}

table.divVset td.msover
{
	padding: 2px 2px 2px 2px;
	border: solid 1px #999999;
	background-color: #A6FFFF;
	white-space:nowrap;
	font-size: 12px;
}

table.divVset td.hitted
{
	padding: 2px 2px 2px 2px;
	border: solid 1px #333333;
	background-color: #CECEFF;
	white-space:nowrap;
	font-size: 12px;
}

</style>

</head>

<body class="MyBody" scroll="yes">


<div style="overflow: auto; text-align: left; height: 35px; background-color: #C1FFE4;"></div>

<table cellpadding='0' cellspacing='0' class='Header3'>
<tr>
<td nowrap="nowrap" align="left" style="background-color:#fcfcfc;">
&nbsp; &nbsp; &nbsp;<input type="button" name="qryList" value="点击进行加载" onclick="execLoad()" />
</td>
</tr>
</table>

<div style="text-align: left; height: 20px; background-color: #C1FFE4;"></div>

<div id="divResultMsg" style="text-align: left; height: 30px; background-color: #C1FFE4;">
<table id="tabResultMsg" style="border: solid 0px #C1FFE4; text-align:left;color: #3E6373; display:none;">
<tr>
<td style="padding: 5px 0px 0px 10px;vertical-align: top;"></td>
<td style="padding-top:5px"><pre id="spanResultMsg" style=" font-size: 12px;"></pre></td>
</tr></table>
</div>

<div id="divHintMsg" style="position:absolute; top:0px; right:30px; z-index: 9901;background:#DDDDDD;filter:alpha(opacity=90);opacity:0.9; border: solid 1px #BCBCBC; display: none;"></div>

<script type="text/javascript">

var reqCount = 0;//请求计数
var isRunning = 0;//状态

function execLoad(){
	if(isRunning == 1){
		OutputResultMsg("当前请求尚未结束");
	}else{
		isRunning = 1;
		AlertMsg("加载中...");
		OutputResultMsg("");
		reqCount++;
		//setTimeout(loadData, 50);
		loadData();
	}
}


function getRuntimeMsg(qreqid){
	if(isRunning==0){
		return;
	}
	var myXmlPath = "/runtimemsg?qreqid="+qreqid;//设置xml文件路径
    var httpReq = new (window.XMLHttpRequest || ActiveXObject)('Microsoft.XMLHTTP');
    httpReq.open("GET", myXmlPath, true);
    httpReq.onreadystatechange = function(){
    	if(httpReq.readyState==4){
    		if(httpReq.responseText != null && httpReq.responseText.length > 0){
    			if(httpReq.responseText != "已结束"){
    				OutputResultMsg(httpReq.responseText);
    				setTimeout(function(){getRuntimeMsg(qreqid);}, 800);
    			}
    		}
    	}
    };
    httpReq.send();
}

function loadData(){
	try {
		var timeNow = new Date();
		var sec = timeNow.getSeconds();
		var milsec = timeNow.getMilliseconds();
		var reqid = sec + "" + milsec + "" + reqCount + "";
		OutputResultMsg("----请求ID："+reqid+"----");
        var myXmlPath = "loadmapping?op=load&reqid="+reqid;//设置xml文件路径
        var httpReq = new (window.XMLHttpRequest || ActiveXObject)('Microsoft.XMLHTTP');
        httpReq.open("GET", myXmlPath, true);
        httpReq.onreadystatechange = function(){
        	if(httpReq.readyState==4){
        		isRunning = 0;
        		AlertMsg("加载结束");
        		if(httpReq.responseText != null && httpReq.responseText.length > 0){
        			OutputResultMsg(httpReq.responseText);
        		}else if(httpReq.status != 200){
            		AlertMsg("非正常结束");
            		//OutputResultMsg(httpReq.status + "-" + httpReq.statusText);
            	}else{
            		//OutputResultMsg(httpReq.responseText);
            	}
        	}
        };
        httpReq.onerror = function(evt) {
        	OutputResultMsg("访问服务器出现错误，status："+httpReq.status+"，请确认服务地址是否可用");
        };
        httpReq.send();
        setTimeout(function(){getRuntimeMsg(reqid);}, 800);
    }
    catch (err) {
        AlertMsg("加载失败");
        OutputResultMsg("此页面存在一个错误。\n\n错误描述: " + err.description);
    }
}

    function AlertMsg(p_Msg) {
        if (p_Msg.length > 0) {
            document.getElementById("divHintMsg").innerHTML = p_Msg;
            document.getElementById("divHintMsg").style.display = "";
        }
        else {
            document.getElementById("divHintMsg").style.display = "none";
        }
    }

    function OutputResultMsg(p_Msg) {
        if (p_Msg.length > 0) {
            document.getElementById("spanResultMsg").innerHTML = p_Msg;
            document.getElementById("tabResultMsg").style.display = "";
        }
        else {
            document.getElementById("tabResultMsg").style.display = "none";
        }
    }
    
</script>
</body></html>

